/**
 * @project_name staff_vehicle
 * @package_name com.ssh.ser.admin
 * @desc TODO
 * @param
 * @author jack
 * @date 2013-4-25
 * @time 下午6:33:08
 */
package com.ssh.ser.admin;

import java.sql.Timestamp;
import java.util.List;

import com.ssh.dao.InnerVehicleDAOI;
import com.ssh.dao.VehicleDAOI;
import com.ssh.entity.InnerVehicle;
import com.ssh.model.pdata.InnerVehicleUseInfo;

/**
 * @author jack
 * @desc 内部车辆管理服务接口
 */
public class VehicleManageSerImpl implements VehicleManageSerI {
	InnerVehicleDAOI innerVehicleDAOI ;

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.VehicleManageSerI#addNewVehicle(com.ssh.entity.InnerVehicle)
	 */
	@Override
	public InnerVehicle addNewVehicle(InnerVehicle innerVehicle) {
		// TODO Auto-generated method stub
		try{
			return innerVehicleDAOI.add(innerVehicle);
		}
		catch(Exception e){
			return null;
		}

	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.VehicleManageSerI#editVehicle(com.ssh.entity.InnerVehicle)
	 */
	@Override
	public InnerVehicle editVehicle(InnerVehicle innerVehicle) {
		// TODO Auto-generated method stub
		try{
			return innerVehicleDAOI.edit(innerVehicle);
		}
		catch(Exception e){
			e.printStackTrace();
			return null;
		}

	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.VehicleManageSerI#viewVehicle(com.ssh.entity.InnerVehicle)
	 */
	@Override
	public InnerVehicle viewVehicle(InnerVehicle innerVehicle) {
		// TODO Auto-generated method stub
		try{
			return innerVehicleDAOI.view(innerVehicle);
		}
		catch(Exception e){
			return null;
		}
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.VehicleManageSerI#viewVehicle(java.lang.String)
	 */
	@Override
	public InnerVehicle viewVehicle(String innerVehicleId) {
		// TODO Auto-generated method stub
		try{
			return innerVehicleDAOI.viewById(innerVehicleId);
		}
		catch(Exception e){
			return null;
		}
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.VehicleManageSerI#viewVehicleList(java.lang.String)
	 */
	@Override
	public List<InnerVehicle> viewVehicleList(String param) {
		// TODO Auto-generated method stub
		try{
			return innerVehicleDAOI.viewVehicleList(param);
		}
		catch(Exception e){
			return null;
		}
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.VehicleManageSerI#deleteVehicle(com.ssh.entity.InnerVehicle)
	 */
	@Override
	public int deleteVehicle(InnerVehicle innerVehicle) {
		// TODO Auto-generated method stub
		try{
			return innerVehicleDAOI.delete(innerVehicle);
		}
		catch(Exception e){
			return 0;
		}
	}

	/**
	 * @return the innerVehicleDAOI
	 */
	public InnerVehicleDAOI getInnerVehicleDAOI() {
		return innerVehicleDAOI;
	}

	/**
	 * @param innerVehicleDAOI the innerVehicleDAOI to set
	 */
	public void setInnerVehicleDAOI(InnerVehicleDAOI innerVehicleDAOI) {
		this.innerVehicleDAOI = innerVehicleDAOI;
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.VehicleManageSerI#viewVehicleByType(java.lang.String)
	 */
	@Override
	public List<InnerVehicle> viewVehicleByType(String type) {
		// TODO Auto-generated method stub
		return innerVehicleDAOI.viewByType(type);
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.VehicleManageSerI#viewVehicleByState(java.lang.String)
	 */
	@Override
	public List<InnerVehicle> viewVehicleByState(String state) {
		// TODO Auto-generated method stub
		return innerVehicleDAOI.viewByState(state);
	}

	@Override
	public List<InnerVehicle> viewVehicleByStateLeavel(String leavel,String state) {
		// TODO Auto-generated method stub
		return innerVehicleDAOI.viewByLeavelState(leavel, state);
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.VehicleManageSerI#viewVByStateType(java.lang.String, java.lang.String)
	 */
	@Override
	public List<InnerVehicle> viewVByStateType(String state, String type) {
		// TODO Auto-generated method stub
		return innerVehicleDAOI.viewVByStateType(state, type);
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.VehicleManageSerI#viewAllVehicle()
	 */
	@Override
	public List<InnerVehicle> viewAllVehicle() {
		// TODO Auto-generated method stub
		return innerVehicleDAOI.getAll();
	}

	/**按输入时间查询出入车辆信息暂未实现*/
	@Override
	public List<InnerVehicleUseInfo> viewVUseInfo(Timestamp startTime,
			Timestamp endTime) {
		// TODO Auto-generated method stub
		return innerVehicleDAOI.queryVUseInfo(startTime, endTime);
	}
	/**按输入时间查询出入车辆信息暂未实现*/
	@Override
	public List<InnerVehicleUseInfo> viewVUseInfo(Timestamp time) {
		// TODO Auto-generated method stub
		return innerVehicleDAOI.queryVUseInfo(time);
	}
	/**车排号查询出入车辆信息*/
	@Override
	public List<InnerVehicleUseInfo> viewVUseInfo(String vehicleId) {
		// TODO Auto-generated method stub
		return innerVehicleDAOI.queryVUseInfo(vehicleId);
	}
	/**查询出入车辆信息*/
	@Override
	public List<InnerVehicleUseInfo> viewAllVUseInfo() {
		// TODO Auto-generated method stub
		return innerVehicleDAOI.queryAllVUseInfo();
	}
}
